-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JAR files are not refreshed after they are updated #1002
Conversation
} | ||
refresh(resource, changeType, monitor); | ||
IProject project = resource.getProject(); | ||
IJavaProject javaProject = JavaCore.create(project); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you need to check it's a Java project beforehand
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the PR.
if (r != null && r.equals(resource)) { | ||
IClasspathEntry[] rawClasspath = javaProject.getRawClasspath(); | ||
javaProject.setRawClasspath(new IClasspathEntry[0], monitor); | ||
javaProject.setRawClasspath(rawClasspath, monitor); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the target classpathEntry is found, add break
to exit ealier.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated.
if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) { | ||
IPath path = entry.getPath(); | ||
IFile resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path); | ||
if (resource != null && resource.exists() && !resource.isDerived()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the jar defined in .classpath was physically missing, then added later, it would not be watched/detected when added
if (resource != null && resource.exists() && !resource.isDerived()) { | ||
IPath location = resource.getLocation(); | ||
if (location != null && !isContainedIn(location, sources)) { | ||
sources.add(location); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
problem is you're later appending /** to the jar extension, which seems to cause some issues on my mac
Signed-off-by: Snjezana Peco <[email protected]>
@fbricon I have updated the PR. |
I don't quite like the hack of calling javaProject.setRawClasspath twice, but it does the job for now. So I'll keep it that way for this release, but hopefully there's a better way to update the classpath and trigger a build |
Fixes redhat-developer/vscode-java#775
Signed-off-by: Snjezana Peco [email protected]